package cn.com.oyat.idea.controller.virtual;


import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ServiceDescriptionController {

    @GetMapping(value = "/upnp/services/avtransport/desc",
            produces = MediaType.APPLICATION_XML_VALUE)
    public String getAVTransportDescription() {
        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<scpd xmlns=\"urn:schemas-upnp-org:service-1-0\">\n" +
                "  <specVersion>\n" +
                "    <major>1</major>\n" +
                "    <minor>0</minor>\n" +
                "  </specVersion>\n" +
                "  <actionList>\n" +
                "    <action>\n" +
                "      <name>SetAVTransportURI</name>\n" +
                "      <argumentList>\n" +
                "        <argument>\n" +
                "          <name>InstanceID</name>\n" +
                "          <direction>in</direction>\n" +
                "          <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>CurrentURI</name>\n" +
                "          <direction>in</direction>\n" +
                "          <relatedStateVariable>AVTransportURI</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>CurrentURIMetaData</name>\n" +
                "          <direction>in</direction>\n" +
                "          <relatedStateVariable>AVTransportURIMetaData</relatedStateVariable>\n" +
                "        </argument>\n" +
                "      </argumentList>\n" +
                "    </action>\n" +
                "    <action>\n" +
                "      <name>Play</name>\n" +
                "      <argumentList>\n" +
                "        <argument>\n" +
                "          <name>InstanceID</name>\n" +
                "          <direction>in</direction>\n" +
                "          <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>Speed</name>\n" +
                "          <direction>in</direction>\n" +
                "          <relatedStateVariable>TransportPlaySpeed</relatedStateVariable>\n" +
                "        </argument>\n" +
                "      </argumentList>\n" +
                "    </action>\n" +
                "    <action>\n" +
                "      <name>Stop</name>\n" +
                "      <argumentList>\n" +
                "        <argument>\n" +
                "          <name>InstanceID</name>\n" +
                "          <direction>in</direction>\n" +
                "          <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>\n" +
                "        </argument>\n" +
                "      </argumentList>\n" +
                "    </action>\n" +
                "    <action>\n" +
                "      <name>GetPositionInfo</name>\n" +
                "      <argumentList>\n" +
                "        <argument>\n" +
                "          <name>InstanceID</name>\n" +
                "          <direction>in</direction>\n" +
                "          <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>Track</name>\n" +
                "          <direction>out</direction>\n" +
                "          <relatedStateVariable>CurrentTrack</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>TrackDuration</name>\n" +
                "          <direction>out</direction>\n" +
                "          <relatedStateVariable>CurrentTrackDuration</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>TrackMetaData</name>\n" +
                "          <direction>out</direction>\n" +
                "          <relatedStateVariable>CurrentTrackMetaData</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>TrackURI</name>\n" +
                "          <direction>out</direction>\n" +
                "          <relatedStateVariable>CurrentTrackURI</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>RelTime</name>\n" +
                "          <direction>out</direction>\n" +
                "          <relatedStateVariable>RelativeTimePosition</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>AbsTime</name>\n" +
                "          <direction>out</direction>\n" +
                "          <relatedStateVariable>AbsoluteTimePosition</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>RelCount</name>\n" +
                "          <direction>out</direction>\n" +
                "          <relatedStateVariable>RelativeCounterPosition</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>AbsCount</name>\n" +
                "          <direction>out</direction>\n" +
                "          <relatedStateVariable>AbsoluteCounterPosition</relatedStateVariable>\n" +
                "        </argument>\n" +
                "      </argumentList>\n" +
                "    </action>\n" +
                "    <action>\n" +
                "      <name>GetTransportInfo</name>\n" +
                "      <argumentList>\n" +
                "        <argument>\n" +
                "          <name>InstanceID</name>\n" +
                "          <direction>in</direction>\n" +
                "          <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>CurrentTransportState</name>\n" +
                "          <direction>out</direction>\n" +
                "          <relatedStateVariable>TransportState</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>CurrentTransportStatus</name>\n" +
                "          <direction>out</direction>\n" +
                "          <relatedStateVariable>TransportStatus</relatedStateVariable>\n" +
                "        </argument>\n" +
                "        <argument>\n" +
                "          <name>CurrentSpeed</name>\n" +
                "          <direction>out</direction>\n" +
                "          <relatedStateVariable>TransportPlaySpeed</relatedStateVariable>\n" +
                "        </argument>\n" +
                "      </argumentList>\n" +
                "    </action>\n" +
                "  </actionList>\n" +
                "  <serviceStateTable>\n" +
                "    <stateVariable sendEvents=\"yes\">\n" +
                "      <name>TransportState</name>\n" +
                "      <dataType>string</dataType>\n" +
                "      <allowedValueList>\n" +
                "        <allowedValue>STOPPED</allowedValue>\n" +
                "        <allowedValue>PLAYING</allowedValue>\n" +
                "        <allowedValue>TRANSITIONING</allowedValue>\n" +
                "        <allowedValue>PAUSED_PLAYBACK</allowedValue>\n" +
                "        <allowedValue>PAUSED_RECORDING</allowedValue>\n" +
                "        <allowedValue>RECORDING</allowedValue>\n" +
                "        <allowedValue>NO_MEDIA_PRESENT</allowedValue>\n" +
                "      </allowedValueList>\n" +
                "    </stateVariable>\n" +
                "    <stateVariable sendEvents=\"yes\">\n" +
                "      <name>TransportStatus</name>\n" +
                "      <dataType>string</dataType>\n" +
                "      <allowedValueList>\n" +
                "        <allowedValue>OK</allowedValue>\n" +
                "        <allowedValue>ERROR_OCCURRED</allowedValue>\n" +
                "      </allowedValueList>\n" +
                "    </stateVariable>\n" +
                "    <stateVariable sendEvents=\"yes\">\n" +
                "      <name>AVTransportURI</name>\n" +
                "      <dataType>string</dataType>\n" +
                "    </stateVariable>\n" +
                "  </serviceStateTable>\n" +
                "</scpd>";
    }
}